Skip to content

add consenter sig verifier tests#994

Open
HagarMeir wants to merge 1 commit into
hyperledger:mainfrom
HagarMeir:sig-verifier-tests
Open

add consenter sig verifier tests#994
HagarMeir wants to merge 1 commit into
hyperledger:mainfrom
HagarMeir:sig-verifier-tests

Conversation

@HagarMeir

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds unit tests around consenter block signature verification by introducing a mockable policy interface and exercising BlockSigVerifier.Verify behavior for malformed signature inputs and policy evaluation outcomes.

Changes:

  • Add //go:generate directive to generate a counterfeiter mock for the internal policy interface.
  • Add extensive BlockSigVerifier.Verify tests using a mocked policy to cover malformed signatures and policy error propagation.
  • Add the generated mocks/policy.go fake implementation.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
node/consensus/synchronizer/sig_verifier.go Adds counterfeiter generation directive for the policy interface to enable mocking in tests.
node/consensus/synchronizer/sig_verifier_test.go Adds mocked-policy tests covering invalid signature encodings/contents and policy success/failure behavior.
node/consensus/synchronizer/mocks/policy.go Adds generated counterfeiter fake for the policy interface used by the new tests.
Files not reviewed (1)
  • node/consensus/synchronizer/mocks/policy.go: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread node/consensus/synchronizer/sig_verifier_test.go Outdated
Comment thread node/consensus/synchronizer/sig_verifier_test.go Outdated
@HagarMeir HagarMeir force-pushed the sig-verifier-tests branch from 879b46f to 2e401f4 Compare July 8, 2026 09:56
Signed-off-by: Hagar Meir <hagar.meir@ibm.com>
@HagarMeir HagarMeir force-pushed the sig-verifier-tests branch from 2e401f4 to f1f2fcd Compare July 8, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants